﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Automobile.service.BLL;
using Automobile.service.Model;

namespace Automobile.service.UI.Handler
{
    /// <summary>
    /// HandlerShipmentAdd 的摘要说明
    /// </summary>
    public class HandlerShipmentAdd : IHttpHandler
    {
        ShipmentsBLL bll = new ShipmentsBLL();
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            Shipments s = new Shipments();
            s.Shipments_blitems = context.Request["Shipments_blitems"].ToString();
            s.Employee_Id = Convert.ToInt32(context.Request["Employee_Id"]);
            s.MemberCard_Id = Convert.ToInt32(context.Request["MemberCard_Id"]);
            s.WareHose_Id = Convert.ToInt32(context.Request["WareHose_Id"]);
            s.Shipments_Price = Convert.ToInt32(context.Request["Shipments_Price"]);
            string xml = context.Server.UrlDecode(context.Request.Form["xml"].ToString());  //xml解码
            context.Response.Write(bll.ShipMentsAddDo(s, xml));
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}